package com.atguigu.srb.core.controller.api;

import com.atguigu.srb.mq.pojo.dto.SmsDTO;
import com.atguigu.srb.mq.service.MqService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/mq/test")
public class ApiMqTest {

    @Autowired
    MqService mqService;

    @GetMapping("/test01")
    public void test01(){
        SmsDTO smsDTO = new SmsDTO();
        smsDTO.setMobile("12333212321");
        smsDTO.setMessage("ok");
        mqService.sendMessage("exchange.recharge.sms","exchange.RoutingKey.sms",smsDTO);
    }

}
